<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
 <%@page import="java.text.SimpleDateFormat"%>
 <%@page import="com.etc.entity.Announcement" %>
<%@page import="com.etc.dao.*" %>
<%@page import="java.util.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>欢迎界面-管理员</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="shortcut icon" href="../Statics/favicon.ico" type="image/x-icon" />
        <link rel="stylesheet" href="../Statics/css/font.css">
        <link rel="stylesheet" href="../Statics/css/xadmin.css">
    </head>
       <%
	request.setCharacterEncoding("UTF-8");
	String username=(String)session.getAttribute("username");
	int count = (int)session.getAttribute("count");
	int count2 = (int)session.getAttribute("count2");
	int count3 = (int)session.getAttribute("count3");
	Date d = new Date();
	SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	String now = df.format(d);
	/* String role=(String)session.getAttribute("userrole");
	String status=(String)session.getAttribute("userstatus");
	String role_info=(role=="admin"||"admin".equals(role))?"管理员":"用户"; */
%>
    <body>
    <div class="x-body layui-anim layui-anim-up">
        <blockquote class="layui-elem-quote">欢迎
            <span class="x-red">管理员:<%=username %></span>！登录时间:<%=now %></blockquote>
        <fieldset class="layui-elem-field">
            <legend>数据统计</legend>
            <div class="layui-field-box">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <div class="layui-carousel x-admin-carousel x-admin-backlog" lay-anim="" lay-indicator="inside" lay-arrow="none" style="width: 100%; height: 90px;">
                                <div carousel-item="">
                                    <ul class="layui-row layui-col-space10 layui-this">
                                        <li class="layui-col-xs2">
                                            <a href="javascript:;" class="x-admin-backlog-body">
                                                <h3>我的文章数</h3>
                                                <p>
                                                    <cite><%=count %></cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs2">
                                            <a href="javascript:;" class="x-admin-backlog-body">
                                                <h3>我的评论数</h3>
                                                <p>
                                                    <cite><%=count2 %></cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs2">
                                            <a href="javascript:;" class="x-admin-backlog-body">
                                                <h3>公告数</h3>
                                                <p>
                                                    <cite><%=count3 %></cite></p>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </fieldset>
        <%
        List<Announcement> list= (List<Announcement>)request.getSession().getAttribute("AnnouncementList");
        %>      
        <fieldset class="layui-elem-field">
            <legend>公告栏</legend>
            <div class="layui-field-box">
            
                <table class="layui-table" lay-skin="line">
                    <tbody>
                    <tr>
                            <td >
                                <a class="x-a" href="../ListAnnouncementServlet?sf=admin" target="_blank">最新公告</a>
                            </td>
                        </tr>
                    <%
                    for(int i=0;i<list.size();i++){
                   	 request.setAttribute("gg", list.get(i)); 
                    %>
                    
                        <tr>
                            <td >
                                ${gg.content }
                            </td>
                        </tr>
                        <%
                    }
                        %>
                    </tbody>
                </table>
            </div>
        </fieldset>
        <fieldset class="layui-elem-field">
            <legend>论坛</legend>
            <div class="layui-field-box">
                <table class="layui-table">
                    <tbody>
                        
                        <tr>
                           <th><a href = "#"> 论坛 </a></th></tr>
                        <tr>
                      
                    </tbody>
                </table>
            </div>
        </fieldset>
        <fieldset class="layui-elem-field">
            <legend>开发团队</legend>
            <div class="layui-field-box">
                <table class="layui-table">
                    <tbody>
                        <tr>
                            <th>版权所有</th>
                            <td>张存哲粉丝后援会
                                </td>
                        </tr>
                        <tr>
                            <th>开发者</th>
                            <td>张存哲粉丝后援会</td></tr>
                    </tbody>
                </table>
            </div>
        </fieldset>
        <blockquote class="layui-elem-quote layui-quote-nm">鸣谢张存哲的大力支持</blockquote>
    </div>
   
    </body>
</html>